package com.wx.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wx.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

@Table(name = "sys_notepad")
@Data
@ApiModel(value = "SysNotepad")
public class SysNotepad extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 6819051009295571796L;

    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    @Column(name = "content")
    @NotEmpty(message = "内容不能为空")
    @ExcelProperty(value = "问询内容", index = 2)
    @ColumnWidth(value = 200)
    private String content;

    @Transient
    @ExcelProperty(value = "护士姓名", index = 1)
    @ColumnWidth(value = 25)
    private String nurseName;

    @Transient
    @ExcelIgnore
    private String nurserId;


    @Transient
    @ExcelProperty(value = "临时序号", index = 0)
    @ColumnWidth(value = 25)
    private String serialNumber;


    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    @Transient
    @ExcelIgnore
    private Date startDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    @Transient
    @ExcelIgnore
    private Date endDate;

    /**
     * 发生时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "发生时间")
    @Transient
    @ExcelProperty(value = "发生时间", index = 3)
    @ColumnWidth(value = 25)
    private Date createTime;

}